<%@ page import="cn.zzszxyy.hr.comm.Global" %><%--
  作者:张伟

  联系:adamzzww@163.com
  时间:2016-11-29
  说明:员工详细信息查看
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <title><%=Global.TITLE%>
    </title>
    <%@include file="../../desktop/include/assets.jsp" %>
    <%
        String url = request.getContextPath() + Global.PATH + "/employee";
    %>
    <style>

    </style>
</head>
<body>
<div class="page-wrapper">

    <div style="margin:20px;">
        <form id="editForm" name="editForm" class="form-horizontal form-condensed" role="form" method="post"
              action="<%=url%>/feedback">
            <table class="table table-bordered">
                <tbody>
                <tr>
                    <th>基本信息
                    </th>
                </tr>
                <tr>
                    <td>
                        <table class="table table-bordered">
                            <tbody>
                            <tr>
                                <th>姓名：</th>
                                <td>
                                    ${entity.employeeName}</td>
                                <th>证件号码：</th>
                                <td>
                                    ${entity.identityCard}</td>
                                <td rowspan="4">
                                    <c:if test="${empty entity.avatar}">
                                        <img data-toggle="lightbox" class="img-thumbnail" alt="员工头像" width="100px"
                                             height="120px"
                                             src="<%=request.getContextPath()%>/assets/upload/avatar/guest.jpg">
                                    </c:if>
                                    <c:if test="${not empty entity.avatar}">
                                        <img data-toggle="lightbox" class="img-thumbnail" alt="员工头像" width="100px"
                                             height="120px"
                                             src="<%=request.getContextPath()%>/assets/upload/avatar/${entity.avatar}">
                                    </c:if>
                                </td>
                            </tr>
                            <tr>
                                <th>员工编号：</th>
                                <td>${entity.employeeSn}</td>
                                <th>性别：</th>
                                <td><c:if test="${entity.sex == 1}">男</c:if><c:if test="${entity.sex == 0}">女</c:if>
                                </td>
                            </tr>
                            <tr>
                                <th>出生日期：</th>
                                <td>
                                    ${entity.birthDay}
                                </td>
                                <th>手机号：</th>
                                <td>${entity.phone}</td>
                            </tr>
                            <tr>
                                <th>籍贯：</th>
                                <td>
                                    ${entity.nativePlace}</td>
                                <th>所属部门：</th>
                                <td>${deptName}

                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </td>
                </tr>
                <tr>
                    <th>其他基本信息</th>
                </tr>
                <tr>
                    <td>
                        <table class="table table-bordered">
                            <tbody>
                            <tr>
                                <th>通讯地址：</th>
                                <td colspan="3">
                                    ${entity.messageAddress}
                                </td>
                            </tr>
                            <tr>
                                <th>员工调动经历</th>
                                <td colspan="3">
                                    <c:if test="${!empty transList }">
                                        <c:forEach items="${transList }" var="trans" varStatus="status">
                                            ${status.index+1}:<span>${trans.employeeName }于<fmt:formatDate
                                                value="${trans.transDate }" pattern="yyyy-MM-dd"/></span>
                                            由于<span>${trans.reason }</span>,从${trans.fromDeptName }调整至${trans.toDeptName };
                                            <br/>
                                        </c:forEach>
                                    </c:if>
                                    <c:if test="${empty transList }">无</c:if>
                                </td>
                            </tr>
                            <tr>
                                <th>用户反馈</th>
                                <td colspan="3">
                                    <textarea rows="3" class="form-control" name="remark">${entity.remark}</textarea>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </td>
                </tr>

                <tr>
                    <th>
                        <input type="hidden" name="employeeId" value="${entity.employeeId}"/>
                        <input type="submit" name="btnSave" value="保存" id="btnSave" class="btn btn-primary">
                        <input type="button" name="btnReturn" value="返回" onclick="javascript:history.go(-1);"
                               class="btn">
                    </th>
                </tr>
                </tbody>
            </table>

        </form>

    </div>


    <script>
        $(function () {
            var validate = $("#editForm").validate({
                //debug: true, //调试模式取消submit的默认提交功能
                rules: {},
                messages: {},
                submitHandler: function (form) {   //表单提交句柄,为一回调函数，带一个参数：form
                    //直接提交表单
                    $.ajax({
                        url: form.action,
                        type: form.method,
                        data: $(form).serialize(),
                        success: function (data) {
                            // 提交表单
                            if (data == "success") {
                                alert("提交成功！");
                                window.location.href = '<%=url%>/list';
                            } else {
                                alert("提交失败！");
                            }
                        }
                    });
                },
            });
        });

    </script>


</div>
</body>
</html>
